import knex from 'knex'

const db_file_path = "./dbdata/db.sqlite3"

export const connection = knex({
	client: 'better-sqlite3',
	connection: {
		filename: db_file_path,
	},

	useNullAsDefault: true,
})

connection.on('query', ({sql, bindings}) => {
	const query = connection.raw(sql, bindings).toQuery();
	console.log('[exec sql]:', query)
})
